Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BTreeMap instead of HashMap for Host config #670

Merged
merged 1 commit into from
May 13, 2024
Merged

Conversation

augustuswm
Copy link
Contributor

Currently the CLI stores the hosts from the host.toml file in a HashMap which means that when a host has not been specified by a user this call gives us back an arbitrary host:

(Err(_), Err(_)) => {
let Some((host, host_entry)) = config.hosts.hosts.iter().next() else {
return Ok(None);
};
(host.clone(), host_entry.token.clone())
}

If we switch this to a BTreeMap we at least guarantee that the cli consistently selects the same host entry.

This is related to #301

Copy link
Collaborator

@ahl ahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ship it

@augustuswm augustuswm merged commit 650a5a8 into main May 13, 2024
16 checks passed
@augustuswm augustuswm deleted the deterministic-host branch May 13, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants